<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<title>微信支付</title>
	<base id="headbase" href="__TMPL__/seatsel/" />
	{include file="./tplnew/public/css_weui.html" /}
<style type="text/css">
.hotel-right-padded {position: absolute;right: 20px;}
.hotel-btn-main {color: #FFF;font-size: 18px;background-color: #ff9a14;border: solid 1px #ff9a14;padding: 9px;}
</style>
</head>
<body>

<header class="wenew-header">
	<a href="javascript:window.history.go(-1);" class="wenew-header-icon-back"><i class="iconfontzz icon-fanhuijiantou w15"></i>返回</a>
	<div class="wenew-header-title">微信支付</div>
</header>

<div class="weui-cells mt10">
	<div class="weui-cell">
		<div class="weui-cell__bd">总金额</div>
		<div class="weui-cell__price">￥{$orderInfo['total_fee']}</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__bd">订单状态</div>
		<div class="weui-cell__price">待支付</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__bd">订单编号</div>
		<div class="weui-cell__price">{$orderInfo['order_no']}</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__bd">下单日期</div>
		<div class="weui-cell__price">{$orderInfo['create_time_show']}</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__bd">支付方式</div>
		<div class="weui-cell__price">微信支付</div>
	</div>
</div>

<div class="p10">
	<button type="submit" class="weui-btn weui-btn_primary" onclick="callpay()">立即支付</button>
</div>

<?php
$layerStyle = 2;
?>
{include file="./tplnew/public/script_wap.html" /}

<script type="text/javascript">
//调用微信JS api 支付
function jsApiCall()
{
	WeixinJSBridge.invoke(
		'getBrandWCPayRequest',
		{$jsApiParameters},
		function(res){
			WeixinJSBridge.log(res.err_msg);
			//alert(res.err_code+res.err_desc+res.err_msg);
			if(res.err_msg == "get_brand_wcpay_request:ok"){
				Wei.Util.wapTip({
					msg : '微信支付成功',
					error : false,
				}, function(){
					setTimeout(function(){
						window.location = "{$returnUrl}";
					}, 500);
				});
			}else{
				history.go(-1);
			}
		}
	);
}

function callpay()
{
	if (typeof WeixinJSBridge == "undefined"){
		if( document.addEventListener ){
			document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		}else if (document.attachEvent){
			document.attachEvent('WeixinJSBridgeReady', jsApiCall);
			document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		}
	}else{
		jsApiCall();
	}
}
</script>

</body>
</html>